// import Vue from 'vue'
import Router from 'vue-router'

const Login = () => import('@/components/Login')
const Index = () => import('@/components/Index')
const HomePage = () => import('@/components/HomePage')
/* setting */
const Staff = () => import('@/components/setting/Staff')
const CompanyInformation = () => import('@/components/setting/CompanyInformation')
const AccountInformation = () => import('@/components/AccountInformation')
const MenuFunction = () => import('@/components/setting/MenuFunction')
const SupplySetting = () => import('@/components/setting/SupplySetting')
const AddSuppliers = () => import('@/components/setting/add_suppliers/AddSuppliers')
const AddAccount = () => import('@/components/setting/staff/AddAccount')
const EditAccount = () => import('@/components/setting/staff/EditAccount')
const EditSuppliers = () => import('@/components/setting/edit_suppliers/EditSuppliers')
const CommissionSetting = () => import('@/components/setting/commission/CommissionSetting')
const EditGoods = () => import('@/components/setting/goods/goods')
const EditType = () => import('@/components/setting/goods/editType')
const ListGoods = () => import('@/components/setting/goods/list')
const ListDetail = () => import('@/components/setting/goods/list_goods_detail')
const EditRoom = () => import('@/components/setting/room/roomSetting')
const UpdateRoomStateColor = () => import('@/components/setting/setRoomStateColor/updateRoomStateColor')
const BreakGoodsList = () => import('@/components/setting/breakGoods/BreakGoodsList')
/* common */
const Account = () => import('@/components/common/Account')
/* hotel */
const HotelInformation = () => import('@/components/hotel/HotelInformation')
const AddHotel = () => import('@/components/hotel/add_hotel/AddHotel')
const HotelBasic = () => import('@/components/hotel/add_hotel/HotelBasic')
const HotelFacilities = () => import('@/components/hotel/add_hotel/HotelFacilities')
const HotelPolicy = () => import('@/components/hotel/add_hotel/HotelPolicy')
const SurroundingFacilities = () => import('@/components/hotel/add_hotel/SurroundingFacilities')
const HotelPicture = () => import('@/components/hotel/add_hotel/HotelPicture')
const SaleHotelList = () => import('@/components/hotel/sale_hotel/SaleHotelList')
const AddSaleHotelList = () => import('@/components/hotel/sale_hotel/AddSaleHotelList')
/* room */
const RoomList = () => import('@/components/room/RoomList')
const AddRoom = () => import('@/components/room/add_room/AddRoom')
const RoomBasic = () => import('@/components/room/add_room/RoomBasic')
const RoomFacilities = () => import('@/components/room/add_room/RoomFacilities')
const RoomPicture = () => import('@/components/room/add_room/RoomPicture')
const RoomManagement = () => import('@/components/room/room_list/RoomManagement')
const PropertyManagement = () => import('@/components/room/room_list/PropertyManagement')
const RoomLog = () => import('@/components/room/RoomLog')
const RoomState = () => import('@/components/roomState/roomstate')
const OpenRoom = () => import('@/components/openRoom/openRoom')
const Repairlist = () => import('@/components/Repair/Repairlist')
/* Marketing  Coupon*/
const CouponIndex = () => import('@/components/Marketing/CouponIndex') //优惠券
const CouponPackage = () => import('@/components/Marketing/CouponPackage') //优惠券包
const AddCouponPackage = () => import('@/components/Marketing/AddCouponPackage') //新增优惠券包
const SeeCouponPackage = () => import('@/components/Marketing/SeeCouponPackage') //查看优惠券包
const OnlinePurchase = () => import('@/components/Marketing/OnlinePurchase') //在线够券
const AddOnlinePurchase = () => import('@/components/Marketing/AddOnlinePurchase') //新增在线够券
const SeeOnlinePurchase = () => import('@/components/Marketing/SeeOnlinePurchase') //查看在线够券

/* order-form */
const OrderForm = () => import('@/components/order-form')
const OrderDetail = () => import('@/components/order-form/detail')
const AddDetail = () => import('@/components/order-form/add')
const FinanceCenter = () => import('@/components/finance')
// const financePayed = () => import('@/components/finance/payed')
// const financePay = () => import('@/components/finance/pay')

/* message */
const Message = () => import('@/components/message/Message')

/** check-in 入住**/
const CheckInList = () => import('@/components/check-in/checkList')
const CheckInDetail = () => import('@/components/check-in/checkDetail')

/**发票管理 */
const InvoiceList = () => import('@/components/invoice/InvoiceList')
const InvoiceDetail = () => import('@/components/invoice/InvoiceDetail')

/***评价 */
const Evaluate = () => import('@/components/evaluate/evaluate')

/****日志中心 */
const LoginCenter = () => import('@/components/logCenter/LogCenter')
// Vue.use(Router)
/***统计 */
const Count = () => import('@/components/count/count')

/**可用房查询 */
const SeachRoom = () => import('@/components/searchRoom/index')

/***排班管理 */
const Scheduling = () => import('@/components/setting/scheduling/index')

/**会议配置管理 */
const MeetingConfig = () => import('@/components/setting/meetingConfig/index')
const AddMeetingReserve = () => import('@/components/setting/meetingConfig/AddMeetingReserve') //新增优惠券包

/***营销通告 ***/

const Notice = () => import('@/components/setting/notice/index')

/**价格设置 */

const PriceConfig = () => import('@/components/setting/priceConfig/index')

//协议单位配置

const AgreementConfig = () => import('@/components/setting/agreementConfig/index')

// 新增编辑协议单位

const UpdateAgreementUnit = () => import('@/components/setting/agreementConfig/updateAgreementUnit')

//  分销配置

const SellConfig = () => import('@/components/saleConfig')

// 绩效目标

const Performance = () => import('@/components/performance')

//营业额查询

const TurnoverEnquiry = () => import('@/components/turnoverEnquiry')

// 账单查询

const BillChecking = () => import('@/components/billChecking')

/**** 会员 ***/
const MemberList = () => import('@/components/member/memberList')
const EditMember = () => import('@/components/member/memberDetail')
const FxList = () => import('@/components/member/fxList')
const OrderMemberDetail = () => import('@/components/member/orderDetail')

/**会员卡配置 */
const MemberCard = () => import('@/components/memberConfig/memberCard/index')
// 会议权限管理
const MemberEquity = () => import('@/components/memberConfig/memberEquity')
// 会议积分管理
const MemberIntegral = () => import('@/components/memberConfig/memberIntegral')
// 会议日管理
const MemberDay = () => import('@/components/memberConfig/memberDay')
// 会议特权管理
const MemberPrivilege = () => import('@/components/memberConfig/memberPrivilege')
//会员卡预览

const MemberView = () => import('@/components/memberConfig/memberCard/view')
const SupDetail = () => import('@/components/member/supDetail')
// 新增会员活动
const AcivityAdd = () => import('@/components/memberConfig/acivityAdd')

//新增修改会员活动表单页面

const ActiveAddEdit = () => import('@/components/memberConfig/activeAddEdit')

// 团购订单

const TgOrder = () => import('@/components/order-form/tgOrder')

//图片轮播

const Banner = () => import('@/components/banner')

const router = new Router({
  routes: [{
      path: '/',
      name: 'main',
      component: Login
    },
    {
      path: '/index',
      name: 'Index',
      component: Index,
      children: [
        {
          path:'tg_order',
          component:TgOrder
        },
       
        {
          path: 'bill-checking',
          component: BillChecking
        },
        {

          path: 'turnover-enquiry',
          component: TurnoverEnquiry
        },
        {
          name: 'performance',
          path: 'performance',
          component: Performance
        },
        {
          path: 'sell_config',
          name: 'SellConfig',
          component: SellConfig
        },
        {
          path: 'home_page',
          name: 'HomePage',
          component: HomePage
        },
        {
          path: 'staff',
          name: 'Staff',
          component: Staff
        },
        {
          path: 'company_information',
          name: 'CompanyInformation',
          component: CompanyInformation
        },
        {
          path: 'account_information',
          name: 'AccountInformation',
          component: AccountInformation
        },
        {
          path: 'menu_function',
          name: 'MenuFunction',
          component: MenuFunction
        },
        {
          path: 'supply_setting',
          name: 'SupplySetting',
          component: SupplySetting
        },
        {
          path: 'add_suppliers',
          name: 'AddSuppliers',
          component: AddSuppliers
        },
        {
          path: 'add_account',
          name: 'AddAccount',
          component: AddAccount
        },
        {
          path: 'log',
          name: 'Log',
          component: Account
        },
        {
          path: 'hotel_information',
          name: 'HotelInformation',
          component: HotelInformation
        },
        {
          path: 'add_hotel',
          name: 'AddHotel',
          component: AddHotel
        },
        {
          path:'supDetail',
          component:SupDetail
        },
        {
          path: 'hotel_basic',
          name: 'HotelBasic',
          component: HotelBasic
        },
        {
          path: 'hotel_facilities',
          name: 'HotelFacilities',
          component: HotelFacilities
        },
        {
          path: 'hotel_policy',
          name: 'HotelPolicy',
          component: HotelPolicy
        },
        {
          path: 'surrounding_facilities',
          name: 'SurroundingFacilities',
          component: SurroundingFacilities
        },
        {
          path: 'memberList',
          name: 'memberList',
          component: MemberList
        },
        {
          path: 'memberDetail',
          name: 'memberDetail',
          component: EditMember
        },
        {
          path: 'fxList',
          name: 'FxList',
          component: FxList
        },
        {
          path: 'orderDetail',
          component: OrderMemberDetail
        },
        {
          path: 'hotel_picture',
          name: 'HotelPicture',
          component: HotelPicture
        },
        {
          path: 'room_list',
          name: 'RoomList',
          component: RoomList
        },
        {
          path: 'add_room',
          name: 'AddRoom',
          component: AddRoom
        },
        {
          path: 'room_basic',
          name: 'RoomBasic',
          component: RoomBasic
        },
        {
          path: 'room_facilities',
          name: 'RoomFacilities',
          component: RoomFacilities
        },
        {
          path: 'room_picture',
          name: 'RoomPicture',
          component: RoomPicture
        },
        {
          path: 'roomState_setting',
          name: 'roomStateSetting',
          component: RoomState
        },
        {
          path: 'sale_hotel',
          name: 'SaleHotelList',
          component: SaleHotelList
        },
        {
          path: 'add_sale_hotel',
          name: 'AddSaleHotelList',
          component: AddSaleHotelList
        },
        {
          path: 'edit_account',
          name: 'EditAccount',
          component: EditAccount
        },
        {
          path: 'property_management',
          name: 'PropertyManagement',
          component: PropertyManagement
        },
        {
          path: 'room_management',
          name: 'RoomManagement',
          component: RoomManagement
        },
        {
          path: 'order_form',
          name: 'orderForm',
          component: OrderForm
        },
        {
          path: 'order_detail',
          name: 'orderDetail',
          component: OrderDetail
        },
        {
          path: 'order_add',
          name: 'AddDetail',
          component: AddDetail
        },
        {
          path: 'finance-center',
          component: FinanceCenter
        },
        {
          path: 'memberCard',
          component: MemberCard
        },
        {
          path: 'memberView',
          component: MemberView
        },
        {
          path: 'memberEquity',
          component: MemberEquity
        },
        {
          path: 'memberIntegral',
          component: MemberIntegral
        },
        {
          path: 'acivityAdd',
          component: AcivityAdd
        },
        {
          path: 'activeAddEdit',
          component: ActiveAddEdit
        },
        {
          path: 'memberDay',
          component: MemberDay
        },
        {
          path: 'memberPrivilege',
          component: MemberPrivilege
        },
        // {
        //   path: 'finance_payed',
        //   name: 'financePayed',
        //   component: financePayed
        // },
        // {
        //   path: 'finance_pay',
        //   name: 'financePay',
        //   component: financePay
        // },
        {
          path: 'edit_suppliers',
          name: 'EditSuppliers',
          component: EditSuppliers
        },
        {
          path: 'edit_goods',
          name: 'EditGoods',
          component: EditGoods
        },
        {
          path: 'edit_type',
          name: 'EditType',
          component: EditType
        },
        {
          path: 'list_goods',
          name: 'ListGoods',
          component: ListGoods
        },
        {
          path: 'list_goods_detail',
          name: 'ListDetail',
          component: ListDetail
        },

        {
          path: 'edit_room',
          name: 'EditRoom',
          component: EditRoom
        },
        {
          path: 'message',
          name: 'Message',
          component: Message
        },
        {
          path: 'commission_setting',
          name: 'CommissionSetting',
          component: CommissionSetting
        },
        {
          path: 'room_log',
          name: 'RoomLog',
          component: RoomLog
        },
        {
          path: 'check-in',
          name: 'checkIn',
          component: CheckInList
        },
        {
          path: 'checkIn-detail',
          name: 'checkDetail',
          component: CheckInDetail
        },
        {
          path: 'open_room',
          name: 'OpenRoom',
          component: OpenRoom
        },
        {
          path: 'Repair_list',
          name: 'Repairlist',
          component: Repairlist
        },
        {
          path: 'invoice_list',
          name: 'InvoiceList',
          component: InvoiceList
        },
        {
          path: 'invoice_detail',
          name: 'InvoiceDetail',
          component: InvoiceDetail
        },
        {
          path: 'set_RoomStateColor',
          name: 'UpdateRoomStateColor',
          component: UpdateRoomStateColor
        },
        {
          path: 'set_break',
          name: 'BreakGoodsList',
          component: BreakGoodsList
        },
        {
          path: 'evaluate',
          name: 'Evaluate',
          component: Evaluate
        },
        {
          path: 'log_center',
          name: 'LoginCenter',
          component: LoginCenter
        },
        {
          path: 'count',
          name: 'Count',
          component: Count
        },
        {
          path: 'seach_room',
          component: SeachRoom
        },
        {
          path: 'scheduling',
          component: Scheduling
        },
        {
          path: 'meetingConfig',
          component: MeetingConfig
        },
        {
          path: 'AddMeetingReserve',
          component: AddMeetingReserve
        },
        {
          path: 'notice',
          component: Notice
        },
        {
          path: 'priceConfig',
          component: PriceConfig
        }, {
          path: 'agreementConfig',
          component: AgreementConfig
        },
        {
          path: 'updateAgreementUnit',
          component: UpdateAgreementUnit
        },
        {
          path: 'Coupon',
          component: CouponIndex
        },
        {
          path: 'CouponPackage',
          component: CouponPackage
        },
        {
          path: 'AddCouponPackage',
          component: AddCouponPackage
        },
        {
          path: 'SeeCouponPackage',
          component: SeeCouponPackage
        },
        {
          path: 'OnlinePurchase',
          component: OnlinePurchase
        },
        {
          path: 'AddOnlinePurchase',
          component: AddOnlinePurchase
        },
        {
          path: 'SeeOnlinePurchase',
          component: SeeOnlinePurchase
        },
        {
          path:'banner',
          component:Banner
        }

      ]
    }
  ]
})
router.beforeEach((to, from, next) => {
  if (to.name != "checkDetail" && to.name != "performance") {
    sessionStorage.removeItem('_activeName');
  }
  next();
})
export default router;
